Switch parser to langlang v0.0.12 Go output - #17
Merged
Conversation
…plementation - Changed the parser generation step in `build.zig` to produce a Go parser instead of a C parser. - Introduced a new `parser.go` file containing the generated Go parser code, implementing the necessary structures and methods for parsing. - Updated output paths and command options to align with Go conventions, including package naming and file structure.
- Introduced a new Go module for the parser with `go.mod` file. - Added `shim.go` to expose the parser as a C-callable interface, enabling integration with Zig. - Updated `.gitignore` to include new parser files and directories.
- Introduced a new build step in `build.zig` to create a CGo c-archive for the Go parser implementation. - Added a system command to build the Go shim as a static library, ensuring proper integration with Zig. - Updated dependencies to reflect the new build process for the parser archive.
- Added environment variables for cross-compilation in `build.zig` to ensure compatibility with Zig target architecture and OS. - Updated the C interface in `CParser.zig` to include the correct header path for the Go parser. - Refactored `translate.zig` to utilize the new Go API, replacing C parser references with Go-compatible types and functions. - Streamlined the parser library linking process in the benchmark executable to use the updated static library.
- Deleted the C parser implementation file `parser.c` and its corresponding header file `parser.h`. - This change reflects the transition to a Go-based parser, aligning with recent updates to the parser architecture and integration with Zig.
…ents - Revised README to include Go as a prerequisite for building the langlang-generated parser and clarified the role of langlang in parser regeneration. - Updated architecture documentation to reflect the transition to a Go-based parser and the new CGo c-archive integration. - Enhanced circuit format documentation to describe the Go parser and its interface with Zig. - Added details about the new `--verbose` flag in CLI arguments, allowing users to enable detailed engine logs during truth table simulations.
- Introduced a new function `linkParserArchive` to simplify the linking of the Go parser c-archive into the build process. - Removed the previous static library linking approach for the parser, allowing the linker to handle the archive directly. - Updated multiple test artifacts to utilize the new linking function, ensuring consistency across the build steps.
- Introduced a new GitHub Actions workflow for end-to-end (E2E) testing, triggered manually or by the `e2e-required` label on pull requests. - Configured the workflow to run the full Zig test suite, including WASM tests, and validate the Linux Docker E2E process. - Set up environment variables and dependencies for Zig, Node, and Go to ensure a consistent testing environment. - This workflow complements the existing PR tests by providing a more comprehensive testing approach.
- Updated the GitHub Actions E2E testing workflow to include two parallel jobs: `wasm-e2e` and `docker-e2e`. - The `wasm-e2e` job runs the full Zig test suite without skipping WASM tests, explicitly surfacing known failures. - The `docker-e2e` job cross-compiles the Zig project for Linux ELF and validates the distribution process in a Docker container. - Improved documentation within the workflow file to clarify job purposes and expected outcomes.
- Deleted the GitHub Actions E2E testing workflow file `.github/workflows/e2e-tests.yml`. - This removal reflects a decision to streamline CI processes and may indicate a shift in testing strategy or reliance on alternative testing methods.
- Updated the build process in `build.zig` to set the C compiler environment variable to `zig cc -target <triple>`, ensuring compatibility for cross-building from macOS. - This change addresses issues with compiling Linux-specific C code when using the host's clang, enhancing the hermeticity of both native and cross-builds.
This was referenced May 22, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
c-outputbranch to the taggedv0.0.12release; the version pin is now a real released artifact rather than a moving commit.golden matcheson every counter and topology hash; the IR is byte-identical to the previous C parser path.--verboseon--truth-table, default-suppressing the engine's per-eventinfo(log)traces so the markdown table on stdout stays clean.DOCS/decisions/tooling.md(new CGo bridge decision section), and parser-layout references across architecture / circuit-format docs.Test plan
zig build test(full suite, including new args tests)zig build bench(golden matches)circ-compile <input>.circ -o <output>.wasmproduces a working artifactcirc-compile <input>.circ --truth-tableemits markdown on stdout, stderr is silentcirc-compile <input>.circ --truth-table --verboseshows engine traces on stderrcirc-compile <input>.circ --inspect --verboserejects with a usage error